package com.sumu.bubei.models.login.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author sumu
 * @since 2022-03-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("Menu")
public class Menu implements Comparable<Menu>, Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "menuID", type = IdType.AUTO)
    private Integer menuID;

    @TableField("parentID")
    private Integer parentID;

    private String title;

    private String key;

    private String icon;

    private String component;

    private String level;

    @TableField("requireAuth")
    private String requireAuth;

    private String standby1;

    private String standby2;

    private String standby3;

    private Integer status;

    @TableField("createUser")
    private String createUser;

    @TableField("createTime")
    private LocalDateTime createTime;

    @TableField("updateUser")
    private String updateUser;

    @TableField("updateTime")
    private LocalDateTime updateTime;

    //子菜单列表
    private List<Menu> subs;

    @Override
    public int compareTo(Menu o) {
        if(this.menuID != o.menuID){
            return this.menuID - o.menuID;
        }
        return 0;
    }
}
